
[dbo].[InventoryTransactionLogMain]
CREATE TABLE [dbo].[InventoryTransactionLogMain]
(
[InventoryTransactionLogKey] [uniqueidentifier] NOT NULL,
[TransactionDate] [datetime] NOT NULL,
[OrderKey] [uniqueidentifier] NULL,
[OrderNumber] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Vendor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ReceiptNumber] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ReturnAuthorization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Notes] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[SystemEntityKey] [uniqueidentifier] NOT NULL,
[OwnerGroupKey] [uniqueidentifier] NULL,
[MarkedForDeleteOn] [datetime] NULL,
[FinalBatchKey] [uniqueidentifier] NULL,
[OriginatingBatchKey] [uniqueidentifier] NULL,
[BatchLineStatusCode] [int] NULL,
[BatchStatusMessage] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogMain] ADD CONSTRAINT [PK_InventoryTransactionLogMain] PRIMARY KEY CLUSTERED ([InventoryTransactionLogKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogMain_OrderKey] ON [dbo].[InventoryTransactionLogMain] ([OrderKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogMain_OrderNumber] ON [dbo].[InventoryTransactionLogMain] ([OrderNumber]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogMain_ReceiptNumber] ON [dbo].[InventoryTransactionLogMain] ([ReceiptNumber]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogMain] ADD CONSTRAINT [FK_InventoryTransactionLogMain_GroupMain_Owner] FOREIGN KEY ([OwnerGroupKey]) REFERENCES [dbo].[GroupMain] ([GroupKey])
GO
ALTER TABLE [dbo].[InventoryTransactionLogMain] ADD CONSTRAINT [FK_InventoryTransactionLogMain_SystemEntity] FOREIGN KEY ([SystemEntityKey]) REFERENCES [dbo].[SystemEntity] ([SystemEntityKey])
GO
ALTER TABLE [dbo].[InventoryTransactionLogMain] ADD CONSTRAINT [FK_InventoryTransactionLogMain_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[InventoryTransactionLogMain] ADD CONSTRAINT [FK_InventoryTransactionLogMain_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO